package com.kongyz.invoker;

import com.kongyz.command.Order;

import java.util.ArrayList;
import java.util.List;

/**
 * @author kongyz
 * @date 2018/7/2 21:17
 * @Description:
 */
public class Broker {
    private List<Order> orderList=new ArrayList<Order>();

    public void takeOrder(Order order){
        orderList.add(order);
    }

    public void placeOrders(){
        for (Order order:orderList){
            order.execute();
        }
        orderList.clear();
    }
}
